package mysql

import "gorm.io/gorm"

type Topic struct {
	gorm.Model
	TopicName  string `gorm:"type:varchar(50);not null;comment:话题名称"`
	TopicIntro string `gorm:"type:varchar(500);comment:话题描述"`
	HotLevel   int64  `gorm:"type:int(11);not null;default:0;comment:话题热度"`
}

func (t *Topic) FirstTopicById(db *gorm.DB, id int64) error {
	return db.Debug().Where("id =?", id).First(t).Error
}
